using System;
using System.Collections.Generic;

namespace Sheep_Breeding.Read.Api.Dtos
{
    /// <summary>
    /// 母羊配种主表+明细表联合DTO（明细为一对多）
    /// </summary>
    public class EweMatingWithDetailDto
    {
        public EweMatingWithDetailDto()
        {
            // 初始化集合，避免空引用
            Details = new List<EweMatingDetailDto>();
            
            // 初始化字符串属性，避免空引用
            BreedingId = string.Empty;
            EarNumber = string.Empty;
            FemaleBreed = string.Empty;
            FemaleType = string.Empty;
            FirstMaleSheep = string.Empty;
            ExtraMaleSheep = string.Empty;
            BreedingMethod = string.Empty;
            FemaleEstrusType = string.Empty;
            BreedingStage = string.Empty;
            BreedingHouse = string.Empty;
            BreedingPen = string.Empty;
            Remark = string.Empty;
            Creator = string.Empty;
        }
        
        // 主表字段
        public string BreedingId { get; set; }
        public DateTime BreedingDate { get; set; }
        public DateTime LastBreedingDate { get; set; }
        public string EarNumber { get; set; }
        public string FemaleBreed { get; set; }
        public string FemaleType { get; set; }
        public string FirstMaleSheep { get; set; }
        public string ExtraMaleSheep { get; set; }
        public string BreedingMethod { get; set; }
        public string FemaleEstrusType { get; set; }
        public string BreedingStage { get; set; }
        public string BreedingHouse { get; set; }
        public string BreedingPen { get; set; }
        public decimal Weight { get; set; }
        public string Remark { get; set; }
        public string Creator { get; set; }
        public DateTime CreateTime { get; set; }
        // 明细表一对多
        public List<EweMatingDetailDto> Details { get; set; }
    }

    /// <summary>
    /// 母羊配种明细DTO
    /// </summary>
    public class EweMatingDetailDto
    {
        public EweMatingDetailDto()
        {
            // 初始化字符串属性，避免空引用
            EventType = string.Empty;
            EventPen = string.Empty;
            EventHouse = string.Empty;
            PredictionStatus = string.Empty;
            Principal = string.Empty;
        }
        
        public int DetailId { get; set; }
        public string EventType { get; set; }
        public string EventPen { get; set; }
        public string EventHouse { get; set; }
        public string PredictionStatus { get; set; }
        public DateTime? EventDate { get; set; }
        public decimal? EventWeight { get; set; }
        public string Principal { get; set; }
    }
} 